﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Linq.Expressions;
using System.Linq;
namespace Infrastructure.Aspect.Expressions
{
    public class ExpressionTreeSample
    {
        public static bool IsOdd(int i)
        {
            return (i & 1) == 1;
        }
        public static void Demo1()
        {
           // Func<int, bool> nonExprLambda = x => (x & 1) == 0;
           //// Expression<Func<int, bool>> exprLambda = x => (x & 1) == 0;
           // //Console.WriteLine(exprLambda.ToString());
           // ParameterExpression xParam = Expression.Parameter(typeof(int), "x");
           // Expression<Func<int, bool>> exprLambda = Expression.Lambda<Func<int, bool>>(
           //     Expression.Equal(
           //         Expression.BitAnd(xParam, Expression.Constant(1)),
           //         Expression.Constant(0)),
           //     xParam);
        }

    }
}
